package com.jediflasher.game_client.server.messages {
	import com.netease.protobuf.*;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class WorldInfoRequest extends com.netease.protobuf.Message {
		public static const USER_ID:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.jediflasher.game_client.server.messages.WorldInfoRequest.user_id", "userId", (1 << 3) | com.netease.protobuf.WireType.VARINT);

		private var user_id$field:int;

		private var hasField$0:uint = 0;

		public function removeUserId():void {
			hasField$0 &= 0xfffffffe;
			user_id$field = new int();
		}

		public function get hasUserId():Boolean {
			return (hasField$0 & 0x1) != 0;
		}

		public function set userId(value:int):void {
			hasField$0 |= 0x1;
			user_id$field = value;
		}

		public function get userId():int {
			return user_id$field;
		}

		public static const X_POS:FieldDescriptor$TYPE_FLOAT = new FieldDescriptor$TYPE_FLOAT("com.jediflasher.game_client.server.messages.WorldInfoRequest.x_pos", "xPos", (2 << 3) | com.netease.protobuf.WireType.FIXED_32_BIT);

		private var x_pos$field:Number;

		public function removeXPos():void {
			hasField$0 &= 0xfffffffd;
			x_pos$field = new Number();
		}

		public function get hasXPos():Boolean {
			return (hasField$0 & 0x2) != 0;
		}

		public function set xPos(value:Number):void {
			hasField$0 |= 0x2;
			x_pos$field = value;
		}

		public function get xPos():Number {
			return x_pos$field;
		}

		public static const Y_POS:FieldDescriptor$TYPE_FLOAT = new FieldDescriptor$TYPE_FLOAT("com.jediflasher.game_client.server.messages.WorldInfoRequest.y_pos", "yPos", (3 << 3) | com.netease.protobuf.WireType.FIXED_32_BIT);

		private var y_pos$field:Number;

		public function removeYPos():void {
			hasField$0 &= 0xfffffffb;
			y_pos$field = new Number();
		}

		public function get hasYPos():Boolean {
			return (hasField$0 & 0x4) != 0;
		}

		public function set yPos(value:Number):void {
			hasField$0 |= 0x4;
			y_pos$field = value;
		}

		public function get yPos():Number {
			return y_pos$field;
		}

		/**
		 *  @private
		 */
		override public final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			if (hasUserId) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
				com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, user_id$field);
			}
			if (hasXPos) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.FIXED_32_BIT, 2);
				com.netease.protobuf.WriteUtils.write$TYPE_FLOAT(output, x_pos$field);
			}
			if (hasYPos) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.FIXED_32_BIT, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_FLOAT(output, y_pos$field);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override public final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var user_id$count:uint = 0;
			var x_pos$count:uint = 0;
			var y_pos$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (user_id$count != 0) {
						throw new flash.errors.IOError('Bad data format: WorldInfoRequest.userId cannot be set twice.');
					}
					++user_id$count;
					userId = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 2:
					if (x_pos$count != 0) {
						throw new flash.errors.IOError('Bad data format: WorldInfoRequest.xPos cannot be set twice.');
					}
					++x_pos$count;
					xPos = com.netease.protobuf.ReadUtils.read$TYPE_FLOAT(input);
					break;
				case 3:
					if (y_pos$count != 0) {
						throw new flash.errors.IOError('Bad data format: WorldInfoRequest.yPos cannot be set twice.');
					}
					++y_pos$count;
					yPos = com.netease.protobuf.ReadUtils.read$TYPE_FLOAT(input);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
